home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / SAT 2.3.7 / Demos / Demo ƒ / StepPlatform Demo ƒ / myPlatform.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-09-05  |  3.0 KB  |  103 lines  |  [TEXT/KAHL]

  1. /************************************************
  2. *    Nissan Zafrir Definations and Types            *
  3. ************************************************/
  4. #define    MaxV(me)        (*(MovPlatP)me->appPtr).MaxV
  5. #define    MinV(me)        (*(MovPlatP)me->appPtr).MinV
  6. #define    MaxH(me)        (*(MovPlatP)me->appPtr).MaxH
  7. #define    MinH(me)        (*(MovPlatP)me->appPtr).MinH
  8.  
  9. typedef struct {
  10.         short    MaxV,MinV;
  11.         short    MaxH,MinH;
  12.         short    filled;    //unused
  13.         } MovPlatRec,*MovPlatP;
  14.  
  15.     /** Actions    **/
  16. enum {    ActionMsgNumber =     5};
  17.  
  18. #define    Stand                    0        //id=128
  19. #define    StandOnHMovPlatform        1        //id=129 the player stands on HMov so he gets his speedH
  20. #define    Jump                    2        //id=130
  21. #define    JumpFromHMov            3        //id=131 jump from HMov Platform
  22. #define    Fall                    4        //id=132
  23.     
  24.     /** JumpKey    **/
  25. #define    Pushed                    1
  26. #define    NotPushed                0
  27.  
  28.  
  29.  
  30. /* Modified sprite struct. */
  31.     typedef struct PlSprite {
  32. /* Variables that you should change as appropriate */
  33.         short            kind;
  34.         Point            position;
  35.         Rect            hotRect, hotRect2;    // Only change hotRect, SAT handles hotRect2
  36.         FacePtr            face;
  37.         pascal void        (*task) (struct Sprite *);
  38.         pascal void        (*hitTask) (struct Sprite *, struct Sprite *);
  39.         pascal void        (*destructTask) (struct Sprite *);
  40.         RgnHandle        clip; /* Clip region to be used when this sprite is drawn. */
  41. /* SAT variables that you shouldn't change: */
  42.         Point            oldpos;
  43.         struct Sprite    *next, *prev;
  44.         Rect            r, oldr;
  45.         FacePtr        oldFace;            //Used by RunSAT2
  46.         Boolean        dirty;        //Used by RunSAT2
  47. /* Variables for free use by the application: */
  48.         short        layer;
  49.         Point            speed;
  50.         short        mode;
  51.         Point        WorldPosition;
  52.         short        action;    // if its a jump,standing,running,or falling
  53.         short        JumpKey;    //released or not
  54.         Ptr            appPtr;
  55.         long            appLong;
  56.         } PlSprite, *PlSpritePtr;
  57.  
  58.  
  59.  
  60. // Routines
  61.  
  62. /* PlayerSprite's interface */
  63. void InitPlayerSprite();
  64.   pascal void SetupPlayerSprite (PlSpritePtr);
  65.  pascal void HandlePlayerSprite (PlSpritePtr);
  66.   pascal void HitPlayerSprite (SpritePtr, SpritePtr);
  67.  
  68. /* PlatformSprite's interface */
  69.  void InitEmptyPlatform();
  70.   pascal void SetupEmptyPlatform (SpritePtr);
  71.   pascal void HandleEmptyPlatform (SpritePtr);
  72.   pascal void HitEmptyPlatform (SpritePtr, PlSpritePtr);
  73.   
  74. /* PlatformSprite's interface */
  75.  void InitPlatform();
  76.   pascal void SetupPlatform (SpritePtr);
  77.   pascal void HandlePlatform (SpritePtr);
  78.   pascal void HitPlatform (SpritePtr, PlSpritePtr);
  79.  
  80. /* PlatformMovSprite's interface */
  81.  void InitMovPlatMovform();
  82.   pascal void SetupMovPlatform(SpritePtr);
  83.   pascal void HandleMovPlatform(SpritePtr);
  84.   pascal void HitMovPlatform(SpritePtr, PlSpritePtr);
  85.  
  86. /* PlatformHMovSprite's interface */
  87.  void InitHMovPlatMovform();
  88.   pascal void SetupHMovPlatform(SpritePtr);
  89.   pascal void HandleHMovPlatform(SpritePtr);
  90.   pascal void HitHMovPlatform(SpritePtr, PlSpritePtr);
  91.  
  92. void InitInformationArea(void);
  93. void DrawProgInfo(SpritePtr    me);
  94. void UpdateInfo(PlSpritePtr    me);
  95. void DrawProgrammerInfo(void);
  96.  
  97. /* prototype for the VBL procs    */
  98.     Boolean InstallVBLCounter(void);
  99.     Boolean RemoveVBLCounter(void);
  100.     pascal int VBLCounterProc(void);
  101.  
  102.  
  103.